UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BWy7SJfM6Krxu0Byg2UYVr6A9gEEjOsjcpCzEYXlIlA=' 
WHERE 
  key_id = '4d4424cb29d30bca9748e7597e898dd0a0d0db4182eaec37b174db3daff25816' 
  AND (
    token = 'BWy7SJfM6Krxu0Byg2UYVr6A9gEEjOsjcpCzEYXlIlA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033