UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AVjeWS72nfS6R6+abt5MfMWl3y/mK9+ORxc2Mmv9XrE=' 
WHERE 
  key_id = '22e3e145906186bb14ed311c9dbc42a19cd0060bcbeddfc29e96342c97cdfddb' 
  AND (
    token = 'AVjeWS72nfS6R6+abt5MfMWl3y/mK9+ORxc2Mmv9XrE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035