UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0+iN2Tclk512eb2M4yYA6dTbF3heJeM7wT8M1JrVgoM=' 
WHERE 
  key_id = '67c20fdbb27f8f19008e129c1dcbe354bf4191b9097fb041941d524958504c17' 
  AND (
    token = '0+iN2Tclk512eb2M4yYA6dTbF3heJeM7wT8M1JrVgoM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023