UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w73irJH1hFoPGT6L1K6ovc/gDl7hZRlfeWolc7GPyVw=' 
WHERE 
  key_id = '1422d1902c75f44a56f738594ff3a53983e09abda8ff7072eb2f6c44b7282060' 
  AND (
    token = 'w73irJH1hFoPGT6L1K6ovc/gDl7hZRlfeWolc7GPyVw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030