UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hLXL4xcHB3pbymiEodm0NhgBRqT1jwhxSmYCnkoC/Wg=' 
WHERE 
  key_id = '9fe16e5661cf530c3925949af11684dbe66f7aa9a39ee22cc175f6ba730d3091' 
  AND (
    token = 'hLXL4xcHB3pbymiEodm0NhgBRqT1jwhxSmYCnkoC/Wg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032