UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UvPkXRWI+s+hw4ARdUTzNR3JBV6TGn6mAvbwRIOtkuc='
WHERE
key_id = '40ca0a7d3ae8e686a4101dc3fb7a6c96ba337bf6dbd4e8131018cecd0afdd2ac'
AND (
token = 'UvPkXRWI+s+hw4ARdUTzNR3JBV6TGn6mAvbwRIOtkuc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)