UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '198DKyuNum3a1Nv771sJToPuvc0CmSNt9Ug8P5m6iRA='
WHERE
key_id = '222a55e8a6508e12cb722d56ef9252c067170356f466459beb1f59ed0aee1c76'
AND (
token = '198DKyuNum3a1Nv771sJToPuvc0CmSNt9Ug8P5m6iRA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)