UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wnkq3lw4o9+kV0eJnQQli2DXIDf3TAEsuX4BwoVVWeU=' 
WHERE 
  key_id = '0133fe7ef7151b3f23ac643fa628dc2722fe07f5671509a15005c08c215351a0' 
  AND (
    token = 'Wnkq3lw4o9+kV0eJnQQli2DXIDf3TAEsuX4BwoVVWeU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036