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

Query time 0.00031