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

Query time 0.00034