UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OhpZ4/0z9zXqKW5RNCYRZYkyWlPQJjWmOnpU57mgVWc=' 
WHERE 
  key_id = '5e3ac5860c5d98f4020fc4b742f86c8285e55a81618cc0fa2d349fe48ce961b8' 
  AND (
    token = 'OhpZ4/0z9zXqKW5RNCYRZYkyWlPQJjWmOnpU57mgVWc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036