UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L5qdeNK4dLpFMxp+doDcP34lxklYV+loCwiqy3KgD24=' 
WHERE 
  key_id = '2d05d228c18eb944c6530e278bc6036fbb4603a77bcd94ddb48f4743a4697ed6' 
  AND (
    token = 'L5qdeNK4dLpFMxp+doDcP34lxklYV+loCwiqy3KgD24=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032