UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3w9uS8CrEjAbvnWRSCglqyz1oTk5RHTMpYsQjPwPLHw='
WHERE
key_id = '1095169e76af352e19ae4e2833d8671692f4675fa06f150be048e0cacb0e1b3b'
AND (
token = '3w9uS8CrEjAbvnWRSCglqyz1oTk5RHTMpYsQjPwPLHw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)