UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HaOmybbFGyygAz6cfIVbDRrtADUiFDOif++leQC/sj4='
WHERE
key_id = '437d4649db7e94308a3428442080f205afb7ffe53d67834a23a1eb0f1fc7ee92'
AND (
token = 'HaOmybbFGyygAz6cfIVbDRrtADUiFDOif++leQC/sj4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)