UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8tASHBUYeZ3guuH5pYVmxTR1nIY14fsJxpTo3Tm+0kQ='
WHERE
key_id = '3cb80c114fe50f419e085860f16298e8fdb5b554e0d368e7f862d2e401444f30'
AND (
token = '8tASHBUYeZ3guuH5pYVmxTR1nIY14fsJxpTo3Tm+0kQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)