UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ne/KCrh1fQtF9quqoym2t1TW2IqcdOXdEW0vWUcYLm4=' 
WHERE 
  key_id = 'b93c47a65eeb4c45272bbb6181f2307845cf4a1117ed3a901322697900d0dba4' 
  AND (
    token = 'ne/KCrh1fQtF9quqoym2t1TW2IqcdOXdEW0vWUcYLm4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040