UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f6VO7zV8A0mKNtm3EXx1hDrSG8WLglpAFcQ1wBirnto=' 
WHERE 
  key_id = '41add67cb40859472acaf6f554f0c86e51f2bebe159b052d78ff9a26384d619a' 
  AND (
    token = 'f6VO7zV8A0mKNtm3EXx1hDrSG8WLglpAFcQ1wBirnto=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054