UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ipVvDVmKDVOTA2ea/nJgOeIGWMYaCMlX5KfmQBBIaUQ=' 
WHERE 
  key_id = '44ac955fbe564d3aee0c9b19ced13693a6330ff0d45fbac871804b7214ebbc89' 
  AND (
    token = 'ipVvDVmKDVOTA2ea/nJgOeIGWMYaCMlX5KfmQBBIaUQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013