UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oqdFSit+265Jh62VSyv0Koq4W6lwAXabPJp9OcYlNOs='
WHERE
key_id = 'ccf8c423c336b15aa951286ea81fa93ce6e270c76edd1a220ba9800906f24f2b'
AND (
token = 'oqdFSit+265Jh62VSyv0Koq4W6lwAXabPJp9OcYlNOs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)