UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xUILsNOtiRQv/qucCjL8aN8FBF6on5bEGlCPTWJOb8M=' 
WHERE 
  key_id = '4211d5f71558461e41722daf2ccde98489cf831f4106c72178478a4c78c95efd' 
  AND (
    token = 'xUILsNOtiRQv/qucCjL8aN8FBF6on5bEGlCPTWJOb8M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041