UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wkyaJDGTTHVOQF+LtDx2iNXtKe4RDLECet9uBLvQVoQ='
WHERE
key_id = '3f65ac0f6e410c6a0bf7d822afdfb02574298d7b86d44da0613f33afec700bc7'
AND (
token = 'wkyaJDGTTHVOQF+LtDx2iNXtKe4RDLECet9uBLvQVoQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)