UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RWe2gFxh+oTtqKQkM/qa6XI2CgGleo5PtusAT6eKFFY=' 
WHERE 
  key_id = '0748a095ef29e2de0e3243672b39e73cf092eacb06e5d4261128f2a90b5eab6e' 
  AND (
    token = 'RWe2gFxh+oTtqKQkM/qa6XI2CgGleo5PtusAT6eKFFY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047