UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TBPdlpWy6JtyJxUqgSDXLBLa0z5M+VhZ38rLviJ4isA='
WHERE
key_id = 'f4da9485d3b906d707ddf6aa10cf2c204328147ee8a22dc723af2d96c1d738d6'
AND (
token = 'TBPdlpWy6JtyJxUqgSDXLBLa0z5M+VhZ38rLviJ4isA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)