UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z3tfr/JiAreUOKb4oY8YA00rIMKxYsha+UXjwXu74WU=' 
WHERE 
  key_id = 'ad0c98eb738a880a4cfafd336110c9241bcffcea3387bc35b2c8d4a37ef99754' 
  AND (
    token = 'z3tfr/JiAreUOKb4oY8YA00rIMKxYsha+UXjwXu74WU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039