UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8gnTssasvml4qleJov52l51C4Z3GPuBcK/vtNnkEJss='
WHERE
key_id = 'db883d1337ead500df19ff385f38630559b0d00d8bf61352fc8446ccf0ce1a67'
AND (
token = '8gnTssasvml4qleJov52l51C4Z3GPuBcK/vtNnkEJss='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)