UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ayxMoBxVQMspFovOp/JCw29J9gWSebUq6I8wvSc3mdQ='
WHERE
key_id = 'f7248273fb4b0bf5aaa08d482938de0c6b180bf5775013240ddec8d98c9afd33'
AND (
token = 'ayxMoBxVQMspFovOp/JCw29J9gWSebUq6I8wvSc3mdQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)