UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3dnHlO0mwkJc7+msr/RZH+tAhYEu7TPTyWnP3zoSpic=' 
WHERE 
  key_id = '72a744ce4bcc08e77682e8edce7dc41ce74a4ee6bc52d3d046e2e0b0e97da574' 
  AND (
    token = '3dnHlO0mwkJc7+msr/RZH+tAhYEu7TPTyWnP3zoSpic=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034