UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4x7lEMOtZ/82V5ns33dUHynFJA8sGfHzZAEiGvodHZ4='
WHERE
key_id = '2a6d7ef83a2468b18d9ab5da89beca824d62d7ab29f3614a8394a511ce3f34bb'
AND (
token = '4x7lEMOtZ/82V5ns33dUHynFJA8sGfHzZAEiGvodHZ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)