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

Query time 0.00027