UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KQuDVYiPutuCDyw05revwNHymxvPVsxl7PW7N0hHodQ=' 
WHERE 
  key_id = '94b5f50095f30fdee19d9b75bab8596f2800f8b65326839ab261e97d956dfe05' 
  AND (
    token = 'KQuDVYiPutuCDyw05revwNHymxvPVsxl7PW7N0hHodQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030