UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's+MKWVXOtVA/m/E51nyWz8hGfCyyBghP5GQMozrt4f4=' 
WHERE 
  key_id = 'df0ed29fba69acbf6b54e1034a001e6ac78149ca79af1b8d66680a5bdb60f495' 
  AND (
    token = 's+MKWVXOtVA/m/E51nyWz8hGfCyyBghP5GQMozrt4f4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034