UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qValcOwxhW/5YT9jp4bNOhU/PP8FrUBmHehjCp1POww='
WHERE
key_id = '88aa7d5274c83a618dc1aa9edf45b4cbbf78c1696af3d6f0965aed5b7a704201'
AND (
token = 'qValcOwxhW/5YT9jp4bNOhU/PP8FrUBmHehjCp1POww='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)