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

Query time 0.00032