UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c3fN0QhfPbCFDbr9xfKRZDRC3x2djlzfD5TJ2yA2tLM='
WHERE
key_id = 'b2b0d0f71dd66381c54ee09c7fef29bea561413a1a14984254d0a5e2794c2cb5'
AND (
token = 'c3fN0QhfPbCFDbr9xfKRZDRC3x2djlzfD5TJ2yA2tLM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)