UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z6cvMBmeYcWYNpE+TTmIo5v1AUmxBEfnOE0HU9dU/zI=' 
WHERE 
  key_id = '438f494b62d0377ef3b5084cb2a6f1dd87d1f9ee21bd902f59b7ecc6bd79d89a' 
  AND (
    token = 'Z6cvMBmeYcWYNpE+TTmIo5v1AUmxBEfnOE0HU9dU/zI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041