UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CfmNHBGjeRc2w3pTIBI0BzRTbS/6ltH6FApG4wkwbHM='
WHERE
key_id = 'be7886d47543893c30a1e492027c193d5b95f677236ff1d05a7b72a57c59e039'
AND (
token = 'CfmNHBGjeRc2w3pTIBI0BzRTbS/6ltH6FApG4wkwbHM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)