UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ixgrK5uzu3oi8t2q9VfD0ehRRUvkjmcos9IwZNLyjOs=' 
WHERE 
  key_id = '0a896693eb4f6ce53c5d0cd992ed79fccbc1ebb19346cf028b7c06d7c538e47b' 
  AND (
    token = 'ixgrK5uzu3oi8t2q9VfD0ehRRUvkjmcos9IwZNLyjOs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016