UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sbFG0v77r+3AHZWCM4UYNAUbHIobdZagzihPw+hENoU='
WHERE
key_id = '09bedb9b107f620c68fa63895be68fa8626261171728640ff59c8ae5a79c3c2e'
AND (
token = 'sbFG0v77r+3AHZWCM4UYNAUbHIobdZagzihPw+hENoU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)