UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jkHOgeLjiFUY8o8GdH1aP7iUMqx9AfN/6vrbToBVcgM=' 
WHERE 
  key_id = '259eafe5e26f41ab7978a7f24cb998bb52897b479f998e9b748a2474676a4e75' 
  AND (
    token = 'jkHOgeLjiFUY8o8GdH1aP7iUMqx9AfN/6vrbToBVcgM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056