UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd8a/pxyTUP88vZTuCQ/hspSWPviyjeQ5GazB3TfwGKI=' 
WHERE 
  key_id = '61c0731ce24b11a3d7b54ec614ea685f5b0615e3066dc98feab63e4de0b7919b' 
  AND (
    token = 'd8a/pxyTUP88vZTuCQ/hspSWPviyjeQ5GazB3TfwGKI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037